//
//  AppDelegate.m
//  NewProject
//
//  Created by 陈洪鑫 on 2018/4/13.
//  Copyright © 2018年 chenIos. All rights reserved.
//
//#import <Gamepaicoresdk/Gamepaicoresdk.h>
//#import <Gamesdklib/Gamesdklib.h>
#import "AppDelegate.h"
#import "ZMainController.h"
#import "ZCreateWalletController.h"
#import "ZBaseNaviController.h"
@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//    [ZGRPC_Manager creatWellet];
    [ZDBManager queryWallets:0 completion:^(NSArray *wallets) {
        if (wallets.count) {
            self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
            self.window.rootViewController = [ZMainController new];

            [self.window makeKeyAndVisible];
            
        }else
        {
            self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
            self.window.rootViewController = [[ZBaseNaviController alloc]initWithRootViewController:[ZCreateWalletController new]];

            [self.window makeKeyAndVisible];
        }
        
    }];
 
    
    // Override point for customization after application launch.
    return YES;
}

- (void)dealloc
{
//    GamepaicoresdkStopCoreDaemon();
}
- (void)applicationWillResignActive:(UIApplication *)application {
     ZWLog(@"applicationWillResignActive");
}


- (void)applicationDidEnterBackground:(UIApplication *)application {
//    GamepaicoresdkStopCoreDaemon();
    ZWLog(@"applicationDidEnterBackground");
}


- (void)applicationWillEnterForeground:(UIApplication *)application {
    ZWLog(@"applicationWillEnterForeground");
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
//     GamepaicoresdkStartCoreDaemon(str);
//    [self copyAssets];
     ZWLog(@"applicationDidBecomeActive");
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}


- (void)applicationWillTerminate:(UIApplication *)application {
    ZWLog(@"applicationWillTerminate");
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}


@end
